home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbwinfnt.zip / EX_DCHAR.BAS < prev    next >
BASIC Source File  |  1994-03-01  |  1KB  |  33 lines

  1.       REM:  EX_DCHAR.BAS, Unregistered Version 1.0
  2.       REM:  Example of using DispChar to display characters.
  3.  
  4.       DECLARE SUB DispChar (Char%, FClr%, BClr%, X%, Y%, FontArray%())
  5.       DECLARE SUB LoadRsrcFileFont (FlName$, FontNum%, FontArray%(), RetCode%, RetMsg$)
  6.  
  7.       '...setup a VGA screen mode...
  8.       SCREEN 12
  9.      
  10.       '...dim array for font data (use REDIM so its DYNAMIC)...
  11.       REDIM FontArray%(1)
  12.    
  13.       PRINT : PRINT "Loading a font from SAMPLE.FON..."
  14.    
  15.       '...load the font in the example FON file...
  16.       CALL LoadRsrcFileFont("SAMPLE.FON", 1, FontArray%(), RetCode%, RetMsg$)
  17.      
  18.       '...check return code, catches non-existent file...
  19.       IF (RetCode% <> 0) THEN STOP
  20.      
  21.       '...display an "A" in foreground and background color...
  22.       CALL DispChar(ASC("A"), 4, 7, 100, 100, FontArray%())
  23.     
  24.       '...display a "B" in foreground color only...
  25.       CALL DispChar(ASC("B"), 4, -1, 100, 130, FontArray%())
  26.     
  27.       '...display a "C" in background color only...
  28.       CALL DispChar(ASC("C"), -1, 7, 100, 160, FontArray%())
  29.  
  30.       END
  31.     
  32.  
  33.